Skip to content

feat(solidstart): Add sentry onBeforeResponse middleware to enable distributed tracing#13221

Merged
andreiborza merged 2 commits intodevelopfrom
ab/solidstart-distributed-tracing-metatags
Aug 5, 2024
Merged

feat(solidstart): Add sentry onBeforeResponse middleware to enable distributed tracing#13221
andreiborza merged 2 commits intodevelopfrom
ab/solidstart-distributed-tracing-metatags

Conversation

@andreiborza
Copy link
Copy Markdown
Member

@andreiborza andreiborza commented Aug 5, 2024

Works by adding the Sentry middlware to your src/middleware.ts file:

import { sentryBeforeResponseMiddleware } from '@sentry/solidstart/middleware';
import { createMiddleware } from '@solidjs/start/middleware';

export default createMiddleware({
  onBeforeResponse: [
    sentryBeforeResponseMiddleware(),
    // Add your other middleware handlers after `sentryBeforeResponseMiddleware`
  ],
});

And specifying ./src/middleware.ts in app.config.ts

CleanShot 2024-08-05 at 08 51 51@2x

Closes: #12551

Copy link
Copy Markdown
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
@andreiborza andreiborza merged commit 4ebac94 into develop Aug 5, 2024
@andreiborza andreiborza deleted the ab/solidstart-distributed-tracing-metatags branch August 5, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add trace metadata to solidstart template

3 participants